#!/usr/bin/env node

const http = require('http'),
      url = require('url');

const addr = 'http://localhost:3000';
let msg = process.argv[2] || 'Hello! I am 123';
const opt = url.parse(addr);
opt.method = 'post';
//opt.heads = {};


const req = http.request(opt,(res) =>{
  console.log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.statusMessage}`);
  console.log(res.headers);
  res.pipe(process.stdout);
});

req.end('userName=wangding&password=1234');
